<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
//不需要登录
Route::post('login',   'AuthController@login')->name('admin.auth.login');//登录
Route::get('logout', 'AuthController@logout')->name('admin.auth.logout');//退出登录
Route::get ('captcha','AuthController@captcha')->name('admin.auth.captcha');//验证码


Route::group(['middleware'=>'auth:admin'], function(){
    Route::get('main', 'IndexController@index')->name('admin.index.index');
    //管理人员
    Route::group(['prefix' => 'manager'], function(){
        Route::get ('/','ManagerController@index')->name('admin.manage.index');//列表
        Route::post('/update', 'ManagerController@update')->name('admin.manage.update');//更新
        Route::post('/destroy', 'ManagerController@destroy')->name('admin.manage.destroy');//删除
        Route::post('/lock', 'ManagerController@lock')->name('admin.manage.lock');//锁定
        Route::post('/active', 'ManagerController@active')->name('admin.manage.active');//激活
    });
    //角色
    Route::group(['prefix' => 'role'], function(){
        Route::get ('/','RoleController@index')->name('admin.role.index');//列表
        Route::post('/update', 'RoleController@update')->name('admin.role.update');//更新
        Route::post('/destroy', 'RoleController@destroy')->name('admin.role.destroy');//删除
        Route::post('/lock', 'RoleController@lock')->name('admin.role.lock');//锁定
        Route::post('/active', 'RoleController@active')->name('admin.role.active');//激活
        Route::post('/all', 'RoleController@all')->name('admin.role.all');//所有
    });
    //权限
    Route::group(['prefix' => 'access'], function(){
        Route::post('/update', 'AccessController@update')->name('admin.access.update');//更新
    });

    //上传
    Route::group(['prefix' => 'upload'], function(){
        Route::post('/image', 'UploadController@image')->name('admin.upload.image');//图片
        Route::post('/file', 'UploadController@file')->name('admin.upload.file');//文件
    });

    //登录日志
    Route::group(['prefix' => 'log'], function(){
        Route::get ('/','LogController@index')->name('admin.login.log');//列表
    });
    //推文管理
    Route::group(['prefix' => 'article'], function(){
        Route::get ('/','ArticleController@index')->name('admin.manage.index');//列表
        Route::get('/info', 'ArticleController@info')->name('admin.manage.info');//详情
        Route::post('/update', 'ArticleController@update')->name('admin.manage.update');//更新
        Route::post('/destroy', 'ArticleController@destroy')->name('admin.manage.destroy');//删除
        Route::get ('/category','ArticleCategoryController@index')->name('admin.category.index');//类目列表
        Route::get ('/category/all','ArticleCategoryController@all')->name('admin.category.all');//所有类目
        Route::post('/category/update', 'ArticleCategoryController@update')->name('admin.category.update');//类目更新
        Route::post('/category/destroy', 'ArticleCategoryController@destroy')->name('admin.category.destroy');//类目删除
    });
    //单页管理
    Route::group(['prefix' => 'page'], function(){
        Route::get ('/','PageController@index')->name('admin.page.index');//列表
        Route::get('/info', 'PageController@info')->name('admin.page.info');//详情
        Route::post('/update', 'PageController@update')->name('admin.page.update');//更新
        Route::post('/destroy', 'PageController@destroy')->name('admin.page.destroy');//删除
    });
    //广告管理
    Route::group(['prefix' => 'adsense'], function(){
        Route::get ('/','AdsenseController@index')->name('admin.adsense.index');//列表
        Route::post('/update', 'AdsenseController@update')->name('admin.adsense.update');//更新
        Route::post('/destroy', 'AdsenseController@destroy')->name('admin.adsense.destroy');//删除
        Route::post('/lock', 'AdsenseController@lock')->name('admin.adsense.lock');//锁定
        Route::post('/active', 'AdsenseController@active')->name('admin.adsense.active');//激活
    });
    //合作商管理
    Route::group(['prefix' => 'partner'], function(){
        Route::get ('/','PartnerController@index')->name('admin.partner.index');//列表
        Route::post('/update', 'PartnerController@update')->name('admin.partner.update');//更新
        Route::post('/destroy', 'PartnerController@destroy')->name('admin.partner.destroy');//删除
        Route::post('/lock', 'PartnerController@lock')->name('admin.partner.lock');//锁定
        Route::post('/active', 'PartnerController@active')->name('admin.partner.active');//激活
    });
    //用户管理
    Route::group(['prefix' => 'user'], function(){
        Route::get ('/','UserController@index')->name('admin.user.index');//列表
        Route::get ('/agent','UserController@agent')->name('admin.user.agent');//代理
    });
    //用户等级
    Route::group(['prefix' => 'level'], function(){
        Route::get ('/','LevelController@index')->name('admin.level.index');//列表
        Route::post('/update', 'LevelController@update')->name('admin.level.update');//更新
        Route::post('/destroy', 'LevelController@destroy')->name('admin.level.destroy');//删除
        Route::post('/all', 'LevelController@all')->name('admin.level.all');//所有
    });
    //积分记录
    Route::group(['prefix' => 'integral'], function(){
        Route::get ('/','IntegralController@index')->name('admin.integral.index');//列表
    });
    //配置
    Route::group(['prefix' => 'config'], function(){
        Route::get ('/','ConfigController@index')->name('admin.config.index');//配置
        Route::post('/update', 'ConfigController@update')->name('admin.config.update');//更新
    });
    //健康档案
    Route::group(['prefix' => 'member'], function(){
        Route::get('/','MemberController@index')->name('admin.member.index');//列表
    });

    // 医单云问诊工单
    Route::group(['prefix' => 'consultation'], function(){
        Route::post('/index','ConsultationController@index')->name('admin.consultation.index');//列表
        Route::post('/destroy', 'ConsultationController@destroy')->name('admin.consultation.destroy');//删除
        Route::post('/reply', 'ConsultationController@reply')->name('admin.consultation.reply');//回复
    });
    // 医单云问诊工单-对话
    Route::group(['prefix' => 'consultation-records'], function(){
        Route::post('/index','ConsultationRecordsController@index')->name('admin.consultationRec.index');//列表
        Route::post('/destroy', 'ConsultationRecordsController@destroy')->name('admin.consultationRec.destroy');//删除
    });
    // 用户分组
    Route::post('/groups/index','GroupsController@index')->name('admin.groups.index');//分组列表
    // 化验单
    Route::post('/ocr/index','OcrController@index')->name('admin.ocr.index');//化验单
    Route::post('/ocr/detail','OcrController@detail')->name('admin.ocr.detail');//化验单详情
    // 提现
    Route::post('/cash/index','CashController@index')->name('admin.cash.index');//提现列表
    Route::post('/cash/agree','CashController@agree')->name('admin.cash.agree');//同意提现
    Route::post('/cash/reject','CashController@reject')->name('admin.cash.reject');//拒绝提现
    // 快递公司
    Route::post('/ex-comp/index','ExpressCompanyController@index')->name('admin.expressCompany.index');//列表
    Route::post('/ex-comp/add','ExpressCompanyController@add')->name('admin.expressCompany.add');//新增、编辑
    Route::post('/ex-comp/del','ExpressCompanyController@del')->name('admin.expressCompany.del');//删除
    // 科室
    Route::post('/department/index','DepartmentController@index')->name('admin.department.index');//列表
    Route::post('/department/add','DepartmentController@add')->name('admin.department.index');//新增、编辑
    Route::post('/department/del','DepartmentController@del')->name('admin.department.index');//删除
    // 专家
    Route::post('/doctor/index','DoctorController@index')->name('admin.doctor.index');//列表
    Route::post('/doctor/agree','DoctorController@agree')->name('admin.doctor.agree');//通过审核
    Route::post('/doctor/reject','DoctorController@reject')->name('admin.doctor.reject');//拒绝
    Route::post('/doctor/del','DoctorController@del')->name('admin.doctor.del');//删除
    // 商品分类
    Route::post('/gcate/index','GoodsCategoryController@index')->name('admin.gcate.index');//列表
    Route::post('/gcate/add','GoodsCategoryController@add')->name('admin.gcate.add');////新增、编辑
    Route::post('/gcate/del','GoodsCategoryController@del')->name('admin.gcate.del');//删除
    // 商品
    Route::post('/goods/index','GoodsController@index')->name('admin.goods.index');//列表
    Route::post('/goods/add','GoodsController@add')->name('admin.goods.add');////新增、编辑
    Route::post('/goods/del','GoodsController@del')->name('admin.goods.del');//删除
    Route::post('/goods/status','GoodsController@setStatus')->name('admin.goods.status');//审核
    Route::post('/goods/rec','GoodsController@setRec')->name('admin.goods.rec');//设置推荐状态
    Route::post('/goods/params','GoodsController@params')->name('admin.goods.params');//列表参数
    // 评论
    Route::post('/ocm/index','OrdersCommentController@index')->name('admin.ocm.index');//列表
    Route::post('/ocm/del','OrdersCommentController@del')->name('admin.ocm.del');//删除
    // 订单
    Route::post('/orders/index','OrdersController@index')->name('admin.orders.index');//列表
});
